package org.feifei.order.service;

import org.feifei.basic.service.BaseService;
import org.feifei.basic.util.PageList;
import org.feifei.order.domain.ProductOrder;
import org.feifei.order.query.ProductOrderQuery;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 服务的Service 层
 */
public interface ProductOrderService extends BaseService<ProductOrder> {
    /**
     * 生成服务订单的方法
     * @param params
     * @param request
     * @return
     */
    String productOrderSubmit(Map<String, Object> params, HttpServletRequest request);

    /**
     * 管理员查看服务订单
     * @param productOrderQuery
     * @param request
     * @return
     */
    PageList<ProductOrder> adminProductOrder(ProductOrderQuery productOrderQuery, HttpServletRequest request);

    /**
     * 用户查看服务订单
     * @param productOrderQuery
     * @param request
     * @return
     */
    PageList<ProductOrder> userProductOrder(ProductOrderQuery productOrderQuery, HttpServletRequest request);

    /**
     * 如果用户支付超时，自动关闭订单，即修改订单的状态为-1
     * @param oid
     */
    void cancelOrder(long oid);
}
